function createUser(loginId, loginPwd, nickName) {
    const sayHello = function () {
        console.log("loginId", this.loginId, "nickname", this.nickName)
    }
    return {
        loginId,  // 属性名的值来自于同名变量，可以这样简写
        loginPwd,
        nickName,
        sayHello,
        id: Math.random()
    }
}


console.log(createUser("abc", "123", "aaa"));
const u = createUser("abc", "123", "aaa");
u.sayHello();